home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
PET
/
S-Super PET
/
(s)t2.d64
/
PRINT.FILE
< prev
next >
Wrap
Text File
|
2009-01-18
|
1KB
|
48 lines
10 ! Program print.file
20 !
30 input "File to be printed:",file_name$
40 open #8,file_name$,input
50 open #4,"ieee4",output
60 lines_per_page%=66 : max_lines%=60 : max_length%=80
70 line%=0 : page%=1
80 lines_to_text%=3
90 !
100 on eof ignore
110 call print_header
120 loop
130 linput #8,x$
140 if io_status = 2 then quit
150 print #4,x$
160 line%=line%+1
170 if line% > max_lines%
180 loop
190 print #4
200 line%=line%+1
210 if line%=lines_per_page% then quit
220 endloop
230 page%=page%+1 : line%=0
240 call print_header
250 endif
260 endloop
270 !
280 close #8
290 close #4
300 stop
310 !
320 proc print_header
330 header$=""
340 for i% = 1 to max_length%
350 header$=header$+" "
360 next i%
370 header$(1:len(file_name$))=file_name$
380 page_number$= "Page " + value$(page%)
390 header$(max_length%-len(page_number$):max_length%)=page_number$
400 print #4,header$
410 line%=line%+1
420 loop
430 print #4
440 line%=line%+1
450 if line% > lines_to_text% then quit
460 endloop
470 endproc